Skip to content

feat(createRecord): Return referenceURL in response#31

Merged
dvcrn merged 1 commit into
dvcrn:mainfrom
TechPrototyper:feature/add-referenceURL-to-createRecord
Apr 23, 2026
Merged

feat(createRecord): Return referenceURL in response#31
dvcrn merged 1 commit into
dvcrn:mainfrom
TechPrototyper:feature/add-referenceURL-to-createRecord

Conversation

@TechPrototyper
Copy link
Copy Markdown
Contributor

Summary

This PR adds the referenceURL field to the create_record response, returning the DEVONthink item link (x-devonthink-item://UUID) alongside the existing uuid field.

Motivation

When automating workflows that span multiple applications, the referenceURL is essential for creating cross-app links. Common use cases include:

  • OmniFocus Integration: Create a DEVONthink document, then immediately add a task in OmniFocus with a clickable link back to it
  • Obsidian/Notes: Reference DEVONthink items from markdown notes using the item URL
  • Calendar Events: Attach relevant DEVONthink documents to calendar entries
  • Shortcuts/Automation: Build macOS Shortcuts that chain document creation with other actions

Currently, users must either:

  1. Manually construct the URL from the UUID (error-prone, undocumented)
  2. Make a second API call to get_record_properties (wasteful, adds latency)

This small change eliminates that friction entirely.

Changes

// src/tools/createRecord.ts
{
  success: true,
  recordId: newRecord.id(),
  name: newRecord.name(),
- uuid: newRecord.uuid()
+ uuid: newRecord.uuid(),
+ referenceURL: newRecord.referenceURL()
}

Testing

Tested with all record types:

  • ✅ Markdown documents
  • ✅ Groups (folders)
  • ✅ Bookmarks
  • ✅ Formatted notes
  • ✅ Records created in specific parent groups

Example response:

{
  "success": true,
  "recordId": 14974,
  "name": "My Document",
  "uuid": "98B409E8-A58A-48AE-8EF2-29D3BFC79750",
  "referenceURL": "x-devonthink-item://98B409E8-A58A-48AE-8EF2-29D3BFC79750"
}

The returned URLs were verified to open the correct record in DEVONthink via open "x-devonthink-item://...".

Backward Compatibility

This is a purely additive change. Existing integrations continue to work unchanged—they simply gain access to an additional field.


Thanks for maintaining this excellent MCP server! 🙏

…response

Adds the DEVONthink item link to the createRecord response, enabling
cross-application automation workflows that need to reference the
newly created record.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the create_record tool to include the referenceURL of the newly created record in its response. The changes involve adding the referenceURL property to the tool's return type interfaces and ensuring the JXA script captures and returns this value from the DEVONthink record. I have no feedback to provide as there are no review comments.

@dvcrn
Copy link
Copy Markdown
Owner

dvcrn commented Apr 23, 2026

lgtm! thanks for the PR ❤️

@dvcrn dvcrn merged commit 164bd50 into dvcrn:main Apr 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants